import { createWebSocket } from "./websocket_base"
import { request } from "./base"
import { ElNotification } from "element-plus"


export const openSearchResult = async(file: string, text: string, textToSearch: string): Promise<void> => {
    const res = (await request.post("/api/text_search/open_search_result", { file, text, search: textToSearch}))
    if (res.status > 300) {
        throw new Error("打开搜索结果失败")
    } else {
        ElNotification.success({
            title: "Success",
            message: "已成功打开搜索结果，请注意查看"
        })
    }
    return
}